/**
 * Created by pankaj on 25/10/14.
 */
define(['jquery'], function($){

    var form = function(){
        var validate = function(){
            var password = $(".js_password_reset .js_pass").val();
            var cpassword = $(".js_password_reset .js_pass_conf").val();
            if (password != cpassword) {
                $(".js_password_reset .js_cpasswordError").css('display', 'block');
                return false;
            } else {
                $(".js_password_reset .js_cpasswordError").css('display', 'none');
            }
            return true;
        };

        // bind click event.
        $(".js_password_reset").find(".js_submit").click(function(e){
            if(validate()){
                $(".js_password_reset").submit();
            }
            e.preventDefault();
        });
    };
    return form;
});